package com.mustafaiev.tair.cts.tapestry.select;

import java.util.Map;

import org.apache.tapestry5.OptionModel;

import com.mustafaiev.tair.cts.tapestry.dto.PayerDTO;

public class PayerSelectOptionModel implements OptionModel {

    private final PayerDTO payerDto;

    public PayerSelectOptionModel(final PayerDTO dto) {
        payerDto = dto;
    }

    public boolean isDisabled() {
        return false;
    }

    public Map<String, String> getAttributes() {
        return null;
    }

    public Object getValue() {
        return payerDto;
    }

    public String getLabel() {
        String label = "";
        if (payerDto != null) {
            label = String.format("%s %s", payerDto.getFirstname(),
                    payerDto.getLastname());
        }
        return label;
    }

}
